<?php

namespace frontend\modules\orders\models;

use Yii;

/**
 * This is the model class for table "cservice_images".
 *
 * @property string $cservice_images_id
 * @property string $cservice_id
 * @property string $cservice_images
 * @property integer $created_at
 */
class CserviceImages extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'cservice_images';
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
//            TimestampBehavior::className(),
            // 名为myBehavior4的行为，也是给出了MyBehavior类的配置数组
            'uuid' => [
                'class' => \common\behavior\uuidBehavior::className(),
                'owner' => $this
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            ['cservice_images_id','default','value'=>$this->getUUID()],
            [['cservice_images_id', 'cservice_id'], 'required'],
            [['created_at'], 'integer'],
            [['cservice_images_id', 'cservice_id'], 'string', 'max' => 40],
            [['cservice_images'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'cservice_images_id' => 'Cservice Images ID',
            'cservice_id' => 'Cservice ID',
            'cservice_images' => 'Cservice Images',
            'created_at' => 'Created At',
        ];
    }

    /**
     * @inheritdoc
     * @return \frontend\modules\orders\models\query\CserviceImagesQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \frontend\modules\orders\models\query\CserviceImagesQuery(get_called_class());
    }
}
